package practice5.quartz;


import java.util.Date;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

/**
 * @author  yeeku.H.lee kongyeeku@163.com
 * @version  1.0
 * <br>Copyright (C), 2005-2008, yeeku.H.Lee
 * <br>This program is protected by copyright laws.
 * <br>Program Name:
 * <br>Date: 
 */
  /*
   * 需要继承 Spring 的 QuartzJobBean 
   */
public class QuartzJob extends QuartzJobBean 
{
	private String name;
	public void setName(String name)
	{
		this.name = name;
	}
	private boolean isRunning;

	protected void executeInternal(JobExecutionContext ctx) throws JobExecutionException 
	{
		if (!isRunning)
		{
			System.out.println(new Date() + "    作业被调度。");
			for (int i = 0; i < 100 ; i++)
			{
				System.out.println("作业完成" + (i + 1) + "%");
			}
			System.out.println(new Date() + "    作业调度结束。");
		}
		else
		{
			System.out.println(new Date() + "任务被调度...");
		}

	}
}